home *** CD-ROM | disk | FTP | other *** search
- /*_ string.h Sun Apr 2 1989 Modified by: Walter Bright */
- /* $Revision: 1.6 $ */
-
- #ifndef __STRING_H
- #define __STRING_H 1
-
- #if __cplusplus
- extern "C" {
- #endif
-
- typedef unsigned size_t;
-
- #ifndef NULL
- #if __COMPACT__ || __LARGE__ || __VCM__
- #define NULL 0L
- #else
- #define NULL 0
- #endif
- #endif
-
- #ifdef __STDC__
- #define __CDECL
- #define __STDCALL
- #else
- #define __CDECL __cdecl
- #define __STDCALL __stdcall
- #endif
-
- #if __OS2__ && __INTSIZE == 4
- #define __CLIB __STDCALL
- #else
- #define __CLIB __CDECL
- #endif
-
- void * __CLIB memcpy(void *,const void *,size_t);
- void * __CLIB memmove(void *,const void *,size_t);
- char * __CLIB strcpy(char *,const char *);
- char * __CLIB _inline_strcpy(char *,const char *);
- char * __CLIB strncpy(char *,const char *,size_t);
- char * __CLIB strcat(char *,const char *);
- char * __CLIB strncat(char *,const char *,size_t);
- int __CLIB memcmp(const void *,const void *,size_t);
- int __CLIB strcmp(const char *,const char *);
- int __CLIB _inline_strcmp(const char *,const char *);
- int __CLIB strcoll(const char *,const char *);
- int __CLIB strncmp(const char *,const char *,size_t);
- size_t __CLIB strxfrm(char *,const char *,size_t);
- void * __CLIB memchr(const void *,int,size_t);
- char * __CLIB strchr(const char *,int);
- size_t __CLIB strcspn(const char *,const char *);
- char * __CLIB strpbrk(const char *,const char *);
- char * __CLIB strrchr(const char *,int);
- size_t __CLIB strspn(const char *,const char *);
- char * __CLIB strstr(const char *,const char *);
- char * __CLIB strtok(char *,const char *);
- void * __CLIB memset(void *,int,size_t);
- char * __CLIB strerror(int);
- size_t __CLIB strlen(const char *);
- size_t __CLIB _inline_strlen(const char *);
-
- #if !__STDC__
- int * __CLIB _memintset(int *, int, size_t);
- int __CLIB memicmp(const void *,const void *,size_t);
- void * __CLIB memccpy(void *,const void *,int,unsigned int);
- char * __CLIB stpcpy(char *,const char *);
- int __CLIB stricmp(const char *,const char *);
- #define strcmpi stricmp
- #define _strcmpi stricmp
-
- int __CLIB strcmpl(const char *,const char *); /* obsolete */
- int __CLIB strnicmp(const char *, const char *, size_t);
- char * __CLIB strdup(const char *);
- char * __CLIB strlwr(char *);
- char * __CLIB strupr(char *);
- char * __CLIB strnset(char *,int,size_t);
- char * __CLIB strrev(char *);
- char * __CLIB strset(char *,int);
- void __CLIB swab(char *,char *,size_t);
- void __CLIB movedata(unsigned short srcseg,unsigned srcoff,unsigned short destseg,unsigned destoff,size_t nbytes);
- extern int __CLIB sys_nerr;
- extern char * __CLIB sys_errlist[];
-
- #define movmem(src,dest,len) ((void)memmove(dest,src,len))
- #define setmem(dest,len,chr) ((void)memset(dest,chr,len))
- #define strncmpi strnicmp
-
- #if 0 /* removed, use strchr() instead */
- char * __CLIB index(const char *,int);
- #endif
-
- #if __INTSIZE == 2 && (__SMALL__ || __MEDIUM__ || __COMPACT__)
- void __far * __CLIB __far fmemcpy(void __far *,const void __far *,size_t);
- void __far * __CLIB __far fmemmove(void __far *,const void __far *,size_t);
- void __far * __CLIB __far fmemchr(const void __far *,int,size_t);
- int __CLIB __far fmemcmp(const void __far *,const void __far *,size_t);
- int __CLIB __far fmemicmp(const void __far *,const void __far *,size_t);
- void __far * __CLIB __far fmemccpy(void __far *,const void __far *,int,unsigned int);
- void __far * __CLIB __far fmemset(void __far *,int,size_t);
- char __far *__CLIB __far fstrcat(char __far *,const char __far*);
- #else
- #define fmemcpy memcpy
- #define fmemmove memmove
- #define fmemchr memchr
- #define fmemcmp memcmp
- #define fmemicmp memicmp
- #define fmemccpy memccpy
- #define fmemset memset
- #define fstrcat strcat
- #define _fstrchr strchr
- #define _fstrcmp strcmp
- #define _fstricmp stricmp
- #define _fstrcpy strcpy
- #define _fstrcspn strcspn
- #define _fstrdup strdup
- #define _fstrlen strlen
- #define _fstrlwr strlwr
- #define _fstrncat strncat
- #define _fstrncmp strncmp
- #define _fstrnicmp strnicmp
- #define _fstrncpy strncpy
- #define _fstrnset strnset
- #define _fstrpbrk strpbrk
- #define _fstrrchr strrchr
- #define _fstrrev strrev
- #define _fstrset strset
- #define _fstrspn strspn
- #define _fstrstr strstr
- #define _fstrtok strtok
- #define _fstrupr strupr
- #endif
-
- #define _movedata movedata
- #define _memicmp memicmp
- #define _memccpy memccpy
- #define _strdup strdup
- #define _strlwr strlwr
- #define _strnset strnset
- #define _strrev strrev
- #define _strset strset
- #define _strupr strupr
- #define _swab swab
- #define _fmemcpy fmemcpy
- #define _fmemcmp fmemcmp
- #define _fmemicmp fmemicmp
- #define _fmemccpy fmemccpy
- #define _fmemmove fmemmove
- #define _fmemchr fmemchr
- #define _fmemset fmemset
- #define _fstrcat fstrcat
- #define _nmemicmp nmemicmp
-
- #endif
-
- #define strcoll(s1,s2) strcmp(s1,s2)
- #define strncmpl(s1,s2,n) strnicmp(s1,s2,n)
-
- #define strcmp(x,y) _inline_strcmp(x,y)
- #define strcpy(x,y) _inline_strcpy(x,y)
- #define strlen(s) _inline_strlen(s)
-
- #if 1 /* some new compiler intrinsics added */
-
- void * __CLIB _inline_memcpy(void *,const void *,size_t);
- int __CLIB _inline_memcmp(const void *,const void *,size_t);
- #define memcpy(s1,s2,n) _inline_memcpy(s1,s2,n)
- #define memcmp(s1,s2,n) _inline_memcmp(s1,s2,n)
-
- char __far * __CLIB _inline_fstrcpy(char __far *,const char __far *);
- int __CLIB _inline_fstrcmp(const char __far *,const char __far *);
- size_t __CLIB _inline_fstrlen(const char __far *);
- void __far * __CLIB _inline_fmemcpy(void __far *,const void __far *,size_t);
- int __CLIB _inline_fmemcmp(const void __far *,const void __far *,size_t);
- #undef _fstrcpy
- #undef _fstrcmp
- #undef _fstrlen
- #undef _fmemcpy
- #undef _fmemcmp
- #define _fstrcpy(s1,s2) _inline_fstrcpy(s1,s2)
- #define _fstrcmp(s1,s2) _inline_fstrcmp(s1,s2)
- #define _fstrlen(s) _inline_fstrlen(s)
- #define _fmemcpy(s1,s2,n) _inline_fmemcpy(s1,s2,n)
- #define _fmemcmp(s1,s2,n) _inline_fmemcmp(s1,s2,n)
-
- #endif
-
- #if __cplusplus
- }
- #endif
-
- #endif /* __STRING_H */
-
-